package cn.sciento.onelink.sim.financial.ec.bill;

import cn.sciento.onelink.AppManager;
import cn.sciento.onelink.CommonResponse;
import cn.sciento.onelink.LinkRequest;
import cn.sciento.onelink.TokenManager;
import cn.sciento.onelink.utils.TransIdUtil;
import lombok.Data;
import org.apache.http.client.methods.HttpRequestBase;

import java.util.HashMap;

/**
 * 集团客户账单实时查询
 * @author waltonlee
 */

@Data
public class SimEcBillRequest extends LinkRequest<CommonResponse<SimEcBillResult>> {
    private String queryDate;

    public SimEcBillRequest(String queryDate) {
        super(Method.GET);
        this.queryDate = queryDate;

    }

    public HttpRequestBase generate() {
        this.path = "/ec/query/ec-bill";
        HashMap<String, Object> bodyMap = new HashMap<String, Object>();
        bodyMap.put("queryDate", queryDate);
        bodyMap.put("transid", TransIdUtil.generate(AppManager.appId));
        bodyMap.put("token", this.getToken());
        this.setCompleteUrl(this.path, bodyMap);
        return httpRequestBase;
    }

}
